/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.huongpq.btvn2;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Admin_Pro
 */
public class Bai2 {

    public static void main(String[] args) {
        try {
            File f = new File("bai 2.txt");
            f.createNewFile();
            FileReader fr = new FileReader(f);
            BufferedReader br = new BufferedReader(fr);

            String a;
            while ((a = br.readLine()) != null) {
                StringTokenizer a1 = new StringTokenizer(a);
                System.out.println("so tu trong xau:  " + a + " la: " + a1.countTokens());
            }
        } catch (Exception ex) {
            Logger.getLogger(Bai2.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
